"use client";
import { useState } from "react";

export default function LikeButton() {
  // 定义状态
  const [likes, setLikes] = useState(0);

  function handleClick() {
    console.log("clicked");
    setLikes(likes + 1);
  }

  return (
    <div style={{ padding: "50px", textAlign: "center" }}>
      <h1>点赞计数器</h1>
      <div>
        <p style={{ fontSize: "24px" }}>当前热度{likes}</p>
      </div>
      <button
        onClick={handleClick}
        style={{
          padding: "10px 20px",
          fontSize: "16px",
          backgroundColor: "#0070f3",
          color: "white",
          border: "none",
          borderRadius: "5px",
          cursor: "pointer",
        }}
      >
        👍 给我也整一个
      </button>
    </div>
  );
}
